/* 新增 main-container 样式，使用 flex 布局 */
.main-container {
  display: flex;
    /* 新增：保证容器至少占满整个视口高度 */
  min-height:100vh;
  height: 600px;
}

.contact-list {
  /* 设置联系人列表宽度 */
  flex: 0 0 25%;
  display: flex;
  flex-direction: column;
  background-color: #f8f8f8;
}

.list-container {
  flex: 1;
  overflow-y: auto;
  background-color: white;
}

.contact-item {
  display: flex;
  align-items: center;
  padding: 12px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.contact-item:hover {
  background-color: #f5f5f5;
}

.contact-item.active {
  background-color: #e6e6e6;
}

.avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.contact-info {
  flex: 1;
  margin-left: 12px;
  min-width: 0;
}

.contact-info .username {
  font-size: 16px;
  color: #333;
  font-weight: 500;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-info .last-message {
  font-size: 14px;
  color: #999;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.last-time {
  flex-shrink: 0;
  font-size: 12px;
  color: #999;
  margin-left: 12px;
}

/* 新增聊天区域样式 */
.chat-area {
  /* 设置聊天区域宽度 */
  flex: 0 0 75%;
  background-color: #f0f0f0;
  padding: 20px;
  height: 100%;
}

.list-scrollbar{
  height: 100%;
}